package com.bianmaba.services.datacollection;

import com.bianmaba.beans.datacollection.CollectionSchedule;
import com.bianmaba.commons.bean.result.OperationResult;
import com.bianmaba.spring.web.service.IBaseService;
import org.quartz.JobKey;
import org.quartz.Trigger;

import java.util.Map;

/**
 * @program: bianmaba-web-framework-extends
 * @description:采集计划业务层
 * @author: Chenjiabin
 * @create: 2018-04-21 11:45
 **/
public interface ICollectionScheduleService extends IBaseService<CollectionSchedule, String> {

    CollectionSchedule saveAndStartSchedule(CollectionSchedule entity) throws ClassNotFoundException;

    boolean stopBySchedulId(String collectionScheduleId);

    boolean stopByJobKey(JobKey jobKey);

    Trigger executeOnce(String taskId, String executor) throws ClassNotFoundException;

    Trigger executeOnce(String taskId, String executor, Map<String, String> overwriteValues) throws ClassNotFoundException;

    OperationResult stopJob(String taskInstanceId);
}
